<template lang="">
    <div style="display:flex;justify-content:space-between;background-color: skyblue;" >
        <h3>车联网后台管理系统欢迎你</h3>
        
  <a-dropdown trigger="click" size="mini" >
    <span>
    <img class="user" :src="userImg">
   </span>
    <a-menu slot="overlay">
      <!-- <a-menu-item>
        <a href="javascript:;">个人中心</a>
      </a-menu-item> -->
      <a-menu-item>
        <a @click="logout">退出登录</a>
      </a-menu-item>
      
    </a-menu>
  </a-dropdown>


    </div>
</template>
<script>
export default {
    data() {
        return {
            userImg: require("../assets/user.png"),
        }
    },
    methods: {
      logout(){
        this.$store.commit('clearToken')
        this.$router.push({ name: '/login' })
      }
    },

}
</script>
<style scoped >


h3 {

    text-align: center;
    float: left;
    padding-left: 20px;
}
.user {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 40px;
    
}
a{
  width: 50px;
  margin-right: 40px;
}
</style>